#include<func.h>
//fopen的fp变为fd
int main(int argc,char*argv[])
{
    ARGS_CHECK(argc,2)
    FILE *fp=fopen(argv[1],"rb+");
    ERROR_CHECK(fp,NULL,"fopen");
    int fd=fileno(fp);
    printf("fd=%d\n",fd);
    char buf[128]={0};
    int ret=read(fd,buf,sizeof(buf));
    ERROR_CHECK(ret,-1,"read");
    printf("buf=%s ret=%d\n",buf,ret);
    fclose(fp);
    return 0;
}